package com.sihan.framework.etm.service.baseData;

import com.framework.model.ApiResult;
import com.framework.model.PageResult;
import com.framework.mybatis.service.BaseService;
import com.sihan.framework.etm.common.PageRequest;
import com.sihan.framework.etm.dto.DeviceExcelDTO;
import com.sihan.framework.etm.dto.DevicePageDTO;
import com.sihan.framework.etm.dto.EtmDeviceMountDTO;
import com.sihan.framework.etm.dto.MountDTO;
import com.sihan.framework.etm.dto.baseData.DeviceDTO;
import com.sihan.framework.etm.dto.baseData.DeviceToolConfigDTO;
import com.sihan.framework.etm.dto.baseData.RecordDTO;
import com.sihan.framework.etm.dto.baseData.RecordListIntervalDTO;
import com.sihan.framework.etm.dto.business.DeviceUserConfigDTO;
import com.sihan.framework.etm.entity.baseData.DeviceModel;
import com.sihan.framework.etm.entity.baseData.DeviceModelDTO;
import com.sihan.framework.etm.entity.business.ManufactorModel;
import com.sihan.framework.etm.vo.ToolIocationMode;
import com.sihan.framework.etm.vo.baseData.DeviceRecordVO;
import com.sihan.framework.etm.vo.baseData.DeviceVO;
import com.sihan.framework.etm.vo.baseData.DeviceWithPositionVO;
import org.json.simple.JSONObject;


import java.util.Date;
import java.util.List;

public interface DeviceService extends BaseService<DeviceModel, String> {

    PageResult<DeviceVO> selectPage(DeviceDTO dto);

    PageResult<DeviceVO> selectDevList(PageRequest pageRequest,
                                       String devcode,
                                       String devname,
                                       String orgId);

    ApiResult<?> saveOrUpdateDevice(DeviceDTO dto);

    ApiResult<?> saveOrDeviceExcelDTO(List<DeviceExcelDTO> dto);

    DeviceVO selectDeviceById(String id);

    void bindOrUnbindDevice(String id, Boolean bindOperate);

    List<String> getAllDeviceCode(Integer stat);

    ApiResult<?> saveOrUpdateDeviceToolConfig(DeviceToolConfigDTO dto);

	ApiResult<?> selectDeviceToolConfigById(String id);

	ApiResult<?> saveOrUpdateDeviceUserConfig(DeviceUserConfigDTO dto);

    ApiResult<?> selectDeviceUserConfigById(String id);

    ApiResult<?> deleteDevice(String id);

    //void receiveRecord(Map<String, String> requestMap);

    void receiveRecord (JSONObject jsonObject, Date date);


    PageResult<DeviceRecordVO> recordList(RecordDTO dto);

    List<DeviceWithPositionVO> recordListInterval(RecordListIntervalDTO dtoList);

    PageResult<DeviceModelDTO> getListDeviceModelDTO(PageRequest pageRequest,
                                                     String deviceName,
                                                     String deviceCode,
                                                     Integer toolType);

    PageResult<DeviceModelDTO> wxGetListDeviceModelDTO(PageRequest pageRequest,String deviceCode);

    DeviceModelDTO getOneDeviceModelDTO(String deviceId);

    Boolean addManufator(ManufactorModel manufactorModel);

    PageResult<EtmDeviceMountDTO> queryDeviceRunningData(DevicePageDTO dto);

    PageResult<EtmDeviceMountDTO> queryDevicePositionData(DevicePageDTO dto);
}
